package top.leyi.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.leyi.IService.IAttenService;
import top.leyi.entity.user.User;
import top.leyi.mapper.AttenMapper;

import java.util.List;

@Service
public class AttenServiceImpl implements IAttenService {
    @Autowired
    AttenMapper attenMapper;
    @Override
    public void attenOne(int vId, int fansId) {
        attenMapper.addAtten(vId, fansId);
    }

    @Override
    public void cancelAtten(int vId, int fansId) {
        attenMapper.removeAtten(vId, fansId);
    }

    @Override
    public List<User> getAlFans(int vId) {
        return attenMapper.queryAllFans(vId);
    }


    @Override
    public List<User> getAllV(int userId) {
        return attenMapper.queryAllV(userId);
    }
}
